﻿using System;
using Ninject;
using System.Web.Mvc;
using Timetable.Base.Interfaces.Services;


namespace Timetable.Site.Attributes
{
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
    public class ValidateActivationAttribute : ActionFilterAttribute
    {
        private readonly String _redirectTo;


        public ValidateActivationAttribute()
        {
            _redirectTo = "ActionDisabled";
        }

        public ValidateActivationAttribute(string redirectTo)
        {
            _redirectTo = redirectTo;
        }

        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            var actionName = filterContext.ActionDescriptor.ActionName;

            //var isValid = (bool)ConfigurationService.GetValue(actionName);

            //if (!isValid)
            //{
              //  filterContext.Result = new RedirectResult(_redirectTo);
            //}
        }

    }
}
